cmake_minimum_required(VERSION 3.16)
project(Skinner LANGUAGES CXX)

include(qt.cmake)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Core)
find_package(Qt${QT_VERSION_MAJOR}
    COMPONENTS
        Core
        Gui
        Widgets
)
qt_standard_project_setup()

set(PROJECT_HEADERS
  Panel.h
  Titlebar.h  
  SkinnerHelper.h
  WindowDecorator.h
  skinner_global.h
)

set(PROJECT_SOURCES
    Panel.cpp
    Titlebar.cpp
    SkinnerHelper.cpp
    WindowDecorator.cpp
)

set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${OUTPUT_DIRECTORY}/Library)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${OUTPUT_DIRECTORY}/Library)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${OUTPUT_DIRECTORY}/Runtime)

include_directories(${SOLUTION_DIR}/Softwarer/Debugging)
include_directories(${SOLUTION_DIR}/Softwarer/QHutu)

add_library(${PROJECT_NAME} SHARED ${PROJECT_HEADERS} ${PROJECT_SOURCES})

link_directories(${SOLUTION_DIR}/Library)

set_target_properties(${PROJECT_NAME}
    PROPERTIES
        WIN32_EXECUTABLE TRUE
)

target_link_libraries(${PROJECT_NAME}
    PUBLIC
        Qt::Core
        Qt::Gui
        Qt::Widgets
)

target_compile_definitions(${PROJECT_NAME}
    PRIVATE
        SKINNER_LIB
)

target_link_libraries(${PROJECT_NAME} PRIVATE Debugging)
target_link_libraries(${PROJECT_NAME} PRIVATE QHutu)